package com.farm.controller;


import com.farm.pojo.User;
import com.farm.service.UserService;
import com.heima.common.exception.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author farm
 * @since 2023-10-30
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @PostMapping("/user/login")
    public ResponseResult userLogin(@RequestBody User user){
        return userService.userLogin(user);
    }

    @PostMapping("/user/info")
    public ResponseResult getUserInfo(@RequestBody User user){
        return userService.getUserInfo(user);
    }
}

